package com.flyxteam.commons.dao.mybatis.api.condition;

import java.io.Serializable;

import com.flyxteam.commons.dao.mybatis.core.constants.ConditionSign;
import com.flyxteam.commons.dao.mybatis.core.constants.LogicSign;

/**
 * 
 * 条件实体类
 * 
 * @author yuzh
 *
 */
public class Condition implements Serializable {

	private static final long serialVersionUID = 6892419602859312225L;

	/** 字段名 */
	private String columnName;
	/** 条件符号 */
	private ConditionSign conditionSign = ConditionSign.EQ;
	/**
	 * 单值字段值，适用于： EQ | GT | GTE | LT | LTE | LIKE | LIKE_PRE | LIKE_FIX |
	 * IS_NULL | IS_NOT_NULL
	 */
	private Object columnValue;
	/** 多只字段值，适用于： BETWEEN | IN */
//	private List<Object> columnMultiValue;
	/** 条件逻辑符号 */
	private LogicSign logicSign = LogicSign.AND;

	public Condition(String columnName, ConditionSign conditionSign, Object columnValue,
			LogicSign logicSign) {
		this.columnName = columnName;
		this.conditionSign = conditionSign;
		this.columnValue = columnValue;
		this.logicSign = logicSign;
	}
	
	public Condition(String columnName, ConditionSign conditionSign, LogicSign logicSign) {
		this.columnName = columnName;
		this.conditionSign = conditionSign;
		this.logicSign = logicSign;
	}
	
	public Condition(String columnName, Object columnValue) {
		this.columnName = columnName;
		this.columnValue = columnValue;
	}

//	public ConditionBean(String columnName, ConditionSign conditionSign, List<Object> columnMultiValue,
//			LogicSign logicSign) {
//		this.columnName = columnName;
//		this.conditionSign = conditionSign;
//		this.columnMultiValue = columnMultiValue;
//		this.logicSign = logicSign;
//	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public ConditionSign getConditionSign() {
		return conditionSign;
	}

	public void setConditionSign(ConditionSign conditionSign) {
		this.conditionSign = conditionSign;
	}

	public Object getColumnValue() {
		return columnValue;
	}

	public void setColumnValue(Object columnValue) {
		this.columnValue = columnValue;
	}

//	public List<Object> getColumnMultiValue() {
//		return columnMultiValue;
//	}

//	public void setColumnMultiValue(List<Object> columnMultiValue) {
//		this.columnMultiValue = columnMultiValue;
//	}

	public LogicSign getLogicSign() {
		return logicSign;
	}

	public void setLogicSign(LogicSign logicSign) {
		this.logicSign = logicSign;
	}

}
